package com.example.springrabbitmq.listener;

import com.example.springrabbitmq.constant.Constants;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class DirectListener {
    @RabbitListener(queues = Constants.DIRECT_QUEUE1)
    public void queueListener1(String message, Channel channel) {
        System.out.println("队列["+ Constants.DIRECT_QUEUE1+"] 接收到消息:" + message + channel);
    }

    @RabbitListener(queues = Constants.DIRECT_QUEUE2)
    public void queueListener2(String message, Channel channel) {
        System.out.println("队列["+ Constants.DIRECT_QUEUE2+"] 接收到消息:" + message + channel);
    }
}
